package byron.server;

import java.io.Serializable;

@SuppressWarnings("serial")
public class CellData implements Serializable {
	private String data;
	
	public CellData(String data) {
		this.data = data;
	}
	
	public String toString() {
		return data;
	}
	
	public float toFloat() {
		float floatValue = 0;
		try {
			floatValue = Float.parseFloat(data.replace(',', '.'));
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}
		return floatValue;
	}
	
	public double toDouble() {
		double doubleValue = 0;
		try {
			doubleValue = Double.parseDouble(data.replace(',', '.'));
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}
		return doubleValue;
	}
	
	public int toInt() {
		int intValue = 0;
		try {
			intValue = Integer.parseInt(data);
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}
		return intValue;
	}
	
}
